<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="../css/02-layout/reset.css" />
    <style>
      .box1 {
        height: 100px;
        width: 100px;
        background-color: black;
        visibility: hidden;
      }
      .s1 {
        padding-top: 50px;
        background-color: #aaa;
        padding-bottom: 50px;
        padding-left: 50px;
        margin-top: 50px;
        border: none 3px red;
        display: block;
        /* visibility: hidden; */
      }
      .s2 {
        background-color: #bfa;
        /* visibility: hidden; */
      }

      .s3 {
        background-color: aqua;
      }
      div {
        width: 600px;
        height: 100px;
        background-color: blueviolet;
      }
      li {
        list-style: none;
        margin-left: 0px;
        border-left-width: 0px;
        padding-left: 0px;
      }
    </style>
  </head>
  <body>
    <div class="box1" id="box1"></div>
    <span class="s1">sssssss1111111111</span>
    <span class="s2">sssssss2222222222</span>
    <span class="s3">sssssss3333333333</span>
    <div class="box2" id="box2"></div>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
    </ul>
    <script>
      let test = document.getElementById("box2");
      let target = document.getElementById("box1");
      test.addEventListener(
        "mouseenter",
        function (event) {
          target.style.visibility = "visible";
        },
        false
      );

      test.addEventListener(
        "mouseleave",
        function (event) {
          target.style.visibility = "hidden";
        },
        false
      );
    </script>
  </body>
</html>
